Skip to content

worktree: conditionally allow worktree on VFS-enabled repos#868

Open
tyrielv wants to merge 1 commit intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/gvfs-worktree
Open

worktree: conditionally allow worktree on VFS-enabled repos#868
tyrielv wants to merge 1 commit intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/gvfs-worktree

Conversation

@tyrielv
Copy link

@tyrielv tyrielv commented Mar 12, 2026

Add GVFS_SUPPORTS_WORKTREES flag (1<<8) to core.gvfs bitmask. When set, allow git worktree commands to run on VFS-enabled repos instead of blocking them with BLOCK_ON_VFS_ENABLED.

Force --no-checkout during worktree add when VFS is active so ProjFS can be mounted before files are projected.

Support skip-clean-check marker file in worktree gitdir: if .git/worktrees//skip-clean-check exists, skip the cleanliness check during worktree remove. This allows VFSForGit's pre-command hook to unmount ProjFS after its own status check, then let git proceed without re-checking (which would fail without the virtual filesystem).

The corresponding change in VFSForGit is microsoft/VFSForGit#1911

  • This change only applies to the virtualization hook and VFS for Git.

@tyrielv tyrielv marked this pull request as ready for review March 12, 2026 16:12
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, even if I left a lot of suggestions (which boil down to only a few, in essence, though). This is very close. Thank you!

@tyrielv tyrielv force-pushed the tyrielv/gvfs-worktree branch 3 times, most recently from bb6390a to 2337249 Compare March 25, 2026 17:41
Copy link
Member

@mjcheetham mjcheetham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit about commenting where 95 comes from for core.gvfs in a test.

nit-nit: Should we also squash the addressing feedback commit into the main commit (with updated message)? I see Copilot as a co-author, and I've found it sadly doesn't like to amend or rebase without being explictly told to keep commits looking 'nice' 😄

@dscho
Copy link
Member

dscho commented Mar 26, 2026

Should we also squash the addressing feedback commit into the main commit (with updated message)?

Probably. Seeing as I blocked Tyrie for so long, I planned on doing that during the next rebase, though.

dscho
dscho previously approved these changes Mar 26, 2026
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tyrielv while I agree with @mjcheetham on both points (the magic "95" constant, and avoiding an "add-on-top" fixup commit), I feel bad for forcing you to wait for my review for so long, so I'd offer to merge this as-is and make the follow-up fixes myself during the next rebase. Or you can make those changes if you want, and have the time. Up to you.

Add GVFS_SUPPORTS_WORKTREES flag (1<<8) to core.gvfs bitmask. When set,
allow git worktree commands to run on VFS-enabled repos instead of
blocking them with BLOCK_ON_VFS_ENABLED.

Force --no-checkout during worktree add when VFS is active so ProjFS can
be mounted before files are projected.

Support skip-clean-check marker file in worktree gitdir: if
.git/worktrees/<name>/skip-clean-check exists, skip the cleanliness
check during worktree remove. This allows VFSForGit's pre-command hook
to unmount ProjFS after its own status check, then let git proceed
without re-checking (which would fail without the virtual filesystem).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyrielv
Copy link
Author

tyrielv commented Mar 26, 2026

@dscho No problem, I've squashed and updated the test and gvfs.h comment per feedback.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants